home *** CD-ROM | disk | FTP | other *** search
/ Interactive Quarterly / The Best of New Machine Publishing 1 - Disc 4: Interactive Quarterly.iso / pc / demos / az / cyberx.dxr / 00188_EFECTOCAJA.ls < prev    next >
Encoding:
Text File  |  1996-10-06  |  4.7 KB  |  120 lines

  1. on efectocaja
  2.   global Tabcajas, num_caja, objeto, caja_cal_1, caja_cal_2, caja_cal_3, caja_escudo, caja_vida, cal_1, cal_2, cal_3, vida, escudo, idioma, pase, max_cal_1, max_cal_2, max_cal_3, max_vida, max_escudo
  3.   set objeto to getAt(Tabcajas, num_caja)
  4.   if objeto = 0 then
  5.     puppetSound("CAJA VACIA")
  6.   else
  7.     puppetSound("CAJA LLENA")
  8.     updateStage()
  9.     puppetSprite(18, 1)
  10.     puppetSprite(19, 1)
  11.     set PosCast to the number of cast "NIV_00.PIC"
  12.     if objeto = 1 then
  13.       set cal_1 to cal_1 + caja_cal_1
  14.       if cal_1 > max_cal_1 then
  15.         set cal_1 to max_cal_1
  16.       end if
  17.       set the castNum of sprite 30 to PosCast + integer((12 * float(cal_1) / float(max_cal_1)) + 0.40000000000000002)
  18.       set nom_objeto to "1-" & string(idioma)
  19.       set imag_objeto to "MUNICION 1"
  20.       set sonido to "M" & string(idioma) & "-11"
  21.     else
  22.       if objeto = 2 then
  23.         set cal_2 to cal_2 + caja_cal_2
  24.         if cal_2 > max_cal_2 then
  25.           set cal_2 to max_cal_2
  26.         end if
  27.         set the castNum of sprite 31 to PosCast + integer((12 * float(cal_2) / float(max_cal_2)) + 0.40000000000000002)
  28.         set nom_objeto to "2-" & string(idioma)
  29.         set imag_objeto to "MUNICION 2"
  30.         set sonido to "M" & string(idioma) & "-12"
  31.       else
  32.         if objeto = 3 then
  33.           set cal_3 to cal_3 + caja_cal_3
  34.           if cal_3 > max_cal_3 then
  35.             set cal_3 to max_cal_3
  36.           end if
  37.           set the castNum of sprite 32 to PosCast + integer((12 * float(cal_3) / float(max_cal_3)) + 0.40000000000000002)
  38.           set nom_objeto to "3-" & string(idioma)
  39.           set imag_objeto to "MUNICION 3"
  40.           set sonido to "M" & string(idioma) & "-13"
  41.         else
  42.           if objeto = 4 then
  43.             set vida to vida + caja_vida
  44.             if vida > max_vida then
  45.               set vida to max_vida
  46.             end if
  47.             set the castNum of sprite 28 to PosCast + integer((12 * float(vida) / float(max_vida)) + 0.40000000000000002)
  48.             set nom_objeto to "4-" & string(idioma)
  49.             set imag_objeto to "VIDA"
  50.             set sonido to "M" & string(idioma) & "-20"
  51.           else
  52.             if objeto = 5 then
  53.               set escudo to escudo + caja_escudo
  54.               if escudo > max_escudo then
  55.                 set escudo to max_escudo
  56.               end if
  57.               set the castNum of sprite 29 to PosCast + integer((12 * float(escudo) / float(max_escudo)) + 0.40000000000000002)
  58.               set nom_objeto to "5-" & string(idioma)
  59.               set imag_objeto to "ESCUDO"
  60.               set sonido to "M" & string(idioma) & "-21"
  61.             else
  62.               if objeto = 6 then
  63.                 set nom_objeto to "6-" & string(idioma)
  64.                 set imag_objeto to "LENCERIA"
  65.                 set sonido to "M" & string(idioma) & "-18"
  66.               else
  67.                 if objeto = 7 then
  68.                   set nom_objeto to "7-" & string(idioma)
  69.                   set imag_objeto to "CD"
  70.                   set sonido to "M" & string(idioma) & "-19"
  71.                 else
  72.                   if objeto = 8 then
  73.                     set nom_objeto to "8-" & string(idioma)
  74.                     set imag_objeto to "CONSOLADOR"
  75.                     set sonido to "M" & string(idioma) & "-17"
  76.                   else
  77.                     if objeto = 9 then
  78.                       set nom_objeto to "9-" & string(idioma)
  79.                       set imag_objeto to "BOLAS"
  80.                       set sonido to "M" & string(idioma) & "-16"
  81.                     else
  82.                       if objeto = 10 then
  83.                         set nom_objeto to "10-" & string(idioma)
  84.                         set imag_objeto to "VIDEO CARD"
  85.                         set the visible of sprite 34 to 1
  86.                         set sonido to "M" & string(idioma) & "-14"
  87.                       else
  88.                         if objeto = 11 then
  89.                           set nom_objeto to "11-" & string(idioma)
  90.                           set imag_objeto to "LLAVE"
  91.                           set the visible of sprite 33 to 1
  92.                           set pase to 1
  93.                           set sonido to "M" & string(idioma) & "-15"
  94.                           updateStage()
  95.                         end if
  96.                       end if
  97.                     end if
  98.                   end if
  99.                 end if
  100.               end if
  101.             end if
  102.           end if
  103.         end if
  104.       end if
  105.     end if
  106.     setAt(Tabcajas, num_caja, 0)
  107.     set the castNum of sprite 18 to the number of cast imag_objeto
  108.     puppetTransition(26, 0, 16)
  109.     updateStage()
  110.     set the castNum of sprite 19 to the number of cast nom_objeto
  111.     puppetTransition(1, 4, 2)
  112.     puppetSound(sonido)
  113.     updateStage()
  114.     repeat while soundBusy(1)
  115.     end repeat
  116.     puppetSound(0)
  117.     startTimer()
  118.   end if
  119. end
  120.